package dhy.lyb.change.service.impl;

import dhy.lyb.change.dao.UserThreeDao;
import dhy.lyb.change.enums.MessageEnum;
import dhy.lyb.change.model.*;
import dhy.lyb.change.service.UserThreeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2016/11/18.
 */
@Service("userThreeService")
public class UserThreeServiceImpl extends BaseServiceImpl<UserThree> implements UserThreeService {

    @Autowired
    private UserThreeDao userThreeDao;

    /**
     * 获取具体dao类
     */
    @Autowired
    public void setBaseDao() {
        super.setBaseDao(userThreeDao);
    }

    @Override
    public int insertRecord(UserThree userthree) {
        //添加数据
        Integer count = userThreeDao.insertRecord(userthree);
        if (count > 0) {
            return MessageEnum.OPERATE_SUCCESS.getValue();
        }
        return MessageEnum.OPERATE_ERROR.getValue();
    }

    @Override
    public List<UserThree> getRecordByCondition(UserThree userThree) {
        return userThreeDao.getRecordByCondition(userThree);
    }
}
